<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let  str = "adfadfadsfasdfasdfasdfadfadfdf2"
        function getMaxTimes(str){
            let arr = str.split('')
            let obj = {}
            arr.forEach(element => {
                if(obj[element]){
                    obj[element] = obj[element]+1
                }else{
                    obj[element] = 1
                }
            });
            console.log(arr)
            console.log(obj)
        }
        getMaxTimes(str)
    </script>
</body>
</html>